home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: What to do when feof() is NOT feof()
- Date: Sat, 24 Feb 96 14:53:32 GMT
- Organization: none
- Message-ID: <825173612snz@genesis.demon.co.uk>
- References: <4g7rsj$fnf@spectator.cris.com> <1996Feb19.063026.29889@zcon.com> <4gb7r3$p4k@sun001.spd.dsccc.com> <4gj6bg$mrv@solutions.solon.com> <312E7ACD.60CF@gate.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <312E7ACD.60CF@gate.net> mwa@gate.net "Mark W. Alexander" writes:
-
- >Peter and Mike wrote stuff debating ethics, but I missed the technical details
- > that started it
- >and have a problem that seems related to the subject...
- >
- >I'm trying to monitor a log file while a process is running by piping tail -f
- > into a C program
- >(Solaris 2.4, if it matters). Everything works wonderfull...until...I have a
- > remote shell that
- >passes exception information to our trouble ticketing system so that the
- > appriopriate (as in not
- >me!) people can be awakened at unpleasent hours. Shortly, (not immediately)
- > after calling
- >system(remote_shell_command) the third or fourth time (abitrary as far as I can
- > tell): feof()
- >becomes true, ferror() is false, and perror() says Interrupted system call
- > (errno=4). In other
- >words:
- >
- > feof() != feof()
-
- Probably something happened (like a signal being received) which, say,
- interrupted a read call and confused your stdio library. There's not
- enough evidence to prove that happened (e.g. the errno value could have
- been set earlier in the program e.g. during the system() call).
-
- >My humble question is: What the ???? I can't clear the error. I can't
- > rewind(stdin). I can't exec
- >another copy to reinitialize everything. What can I do?
-
- Did you try clearerr() ?
-
- Other than that I don't think the C language can help you much - you really
- need a Unix/Solaris specific discussion (i.e. comp.unix.programmer).
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-